-- @owner: opentestcase016
-- @date: 2024/2/3
-- @testpoint: 含有inout类型参数的函数,在另一个函数中调用该函数,不调用inout参数,合理报错

--step01:创建一个函数inout的函数,调用该函数 expect:成功
drop function if exists t_ddl_create_fun_0157; 
create or replace function t_ddl_create_fun_0157(i int, inout result_1 bigint, out result_2 bigint)
returns setof record
as $$
begin
    result_1 = result_1 + 1;
    result_2 = i * 10;
return next;
end;
$$language plpgsql;
/

select t_ddl_create_fun_0157(1,2);

--step02:创建另一个函数,调用函数1,不调用inout参数 expect:合理报错
drop function if exists t_ddl_create_fun_0157_01;
create or replace function t_ddl_create_fun_0157_01(i int)
returns void 
as $$
begin
   perform t_ddl_create_fun_0157(i);
end;
$$language plpgsql;
/

--step03:清理环境 expect:成功
drop function t_ddl_create_fun_0157;
